package com.wmm.controller;

import com.wmm.common.ProductVo;
import com.wmm.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("search")
public class SearchController {

    @Autowired
    private ProductService productService;

    @PostMapping("product")
    public Map getProduct(@RequestBody ProductVo productVo) {
        return productService.queryEsByName(productVo);
    }
}
